package com.czp.user.junit;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.czp.user.model.RelationRole;



public class Test {
	
	@org.junit.Test
	public void test() {
		String json = "[{personId:'3', roleId:'113'},{personId:'3', roleId:'114'}]";
		JSONArray jsonArr = JSONArray.fromObject(json);
		RelationRole relRole = new RelationRole();
		for(int i = 0; i < jsonArr.size(); i++) {
			JSONObject jsonObj = jsonArr.getJSONObject(i);
			relRole = (RelationRole) JSONObject.toBean(jsonObj, relRole.getClass());
			System.out.println(jsonObj);
			System.out.println(relRole.toString());
		}
	}
}
